Optimal. Leaf size=89 \[ -\frac {a (B+i A) \cot ^2(c+d x)}{2 d}+\frac {a (A-i B) \cot (c+d x)}{d}-\frac {a (B+i A) \log (\sin (c+d x))}{d}+a x (A-i B)-\frac {a A \cot ^3(c+d x)}{3 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.15, antiderivative size = 89, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 32, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {3591, 3529, 3531, 3475} \[ -\frac {a (B+i A) \cot ^2(c+d x)}{2 d}+\frac {a (A-i B) \cot (c+d x)}{d}-\frac {a (B+i A) \log (\sin (c+d x))}{d}+a x (A-i B)-\frac {a A \cot ^3(c+d x)}{3 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3475
Rule 3529
Rule 3531
Rule 3591
Rubi steps
\begin {align*} \int \cot ^4(c+d x) (a+i a \tan (c+d x)) (A+B \tan (c+d x)) \, dx &=-\frac {a A \cot ^3(c+d x)}{3 d}+\int \cot ^3(c+d x) (a (i A+B)-a (A-i B) \tan (c+d x)) \, dx\\ &=-\frac {a (i A+B) \cot ^2(c+d x)}{2 d}-\frac {a A \cot ^3(c+d x)}{3 d}+\int \cot ^2(c+d x) (-a (A-i B)-a (i A+B) \tan (c+d x)) \, dx\\ &=\frac {a (A-i B) \cot (c+d x)}{d}-\frac {a (i A+B) \cot ^2(c+d x)}{2 d}-\frac {a A \cot ^3(c+d x)}{3 d}+\int \cot (c+d x) (-a (i A+B)+a (A-i B) \tan (c+d x)) \, dx\\ &=a (A-i B) x+\frac {a (A-i B) \cot (c+d x)}{d}-\frac {a (i A+B) \cot ^2(c+d x)}{2 d}-\frac {a A \cot ^3(c+d x)}{3 d}-(a (i A+B)) \int \cot (c+d x) \, dx\\ &=a (A-i B) x+\frac {a (A-i B) \cot (c+d x)}{d}-\frac {a (i A+B) \cot ^2(c+d x)}{2 d}-\frac {a A \cot ^3(c+d x)}{3 d}-\frac {a (i A+B) \log (\sin (c+d x))}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] time = 0.72, size = 102, normalized size = 1.15 \[ -\frac {a \left (3 (B+i A) \left (\cot ^2(c+d x)+2 (\log (\tan (c+d x))+\log (\cos (c+d x)))\right )+2 A \cot ^3(c+d x) \, _2F_1\left (-\frac {3}{2},1;-\frac {1}{2};-\tan ^2(c+d x)\right )+6 i B \cot (c+d x) \, _2F_1\left (-\frac {1}{2},1;\frac {1}{2};-\tan ^2(c+d x)\right )\right )}{6 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.41, size = 166, normalized size = 1.87 \[ \frac {{\left (18 i \, A + 12 \, B\right )} a e^{\left (4 i \, d x + 4 i \, c\right )} + {\left (-18 i \, A - 18 \, B\right )} a e^{\left (2 i \, d x + 2 i \, c\right )} + {\left (8 i \, A + 6 \, B\right )} a + {\left ({\left (-3 i \, A - 3 \, B\right )} a e^{\left (6 i \, d x + 6 i \, c\right )} + {\left (9 i \, A + 9 \, B\right )} a e^{\left (4 i \, d x + 4 i \, c\right )} + {\left (-9 i \, A - 9 \, B\right )} a e^{\left (2 i \, d x + 2 i \, c\right )} + {\left (3 i \, A + 3 \, B\right )} a\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} - 1\right )}{3 \, {\left (d e^{\left (6 i \, d x + 6 i \, c\right )} - 3 \, d e^{\left (4 i \, d x + 4 i \, c\right )} + 3 \, d e^{\left (2 i \, d x + 2 i \, c\right )} - d\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.96, size = 221, normalized size = 2.48 \[ \frac {A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 3 i \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 3 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 15 \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 12 i \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 48 \, {\left (i \, A a + B a\right )} \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + i\right ) - 24 \, {\left (i \, A a + B a\right )} \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right ) - \frac {-44 i \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 44 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 15 \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 12 i \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 3 i \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + A a}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3}}}{24 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.39, size = 129, normalized size = 1.45 \[ -\frac {i A a \left (\cot ^{2}\left (d x +c \right )\right )}{2 d}-\frac {i A a \ln \left (\sin \left (d x +c \right )\right )}{d}-i B a x -\frac {i B \cot \left (d x +c \right ) a}{d}-\frac {i B a c}{d}-\frac {a A \left (\cot ^{3}\left (d x +c \right )\right )}{3 d}+\frac {a A \cot \left (d x +c \right )}{d}+a A x +\frac {A a c}{d}-\frac {a B \left (\cot ^{2}\left (d x +c \right )\right )}{2 d}-\frac {a B \ln \left (\sin \left (d x +c \right )\right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.91, size = 103, normalized size = 1.16 \[ \frac {6 \, {\left (d x + c\right )} {\left (A - i \, B\right )} a - 3 \, {\left (-i \, A - B\right )} a \log \left (\tan \left (d x + c\right )^{2} + 1\right ) + 6 \, {\left (-i \, A - B\right )} a \log \left (\tan \left (d x + c\right )\right ) + \frac {6 \, {\left (A - i \, B\right )} a \tan \left (d x + c\right )^{2} - {\left (3 i \, A + 3 \, B\right )} a \tan \left (d x + c\right ) - 2 \, A a}{\tan \left (d x + c\right )^{3}}}{6 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 6.25, size = 80, normalized size = 0.90 \[ -\frac {\left (-A\,a+B\,a\,1{}\mathrm {i}\right )\,{\mathrm {tan}\left (c+d\,x\right )}^2+\left (\frac {B\,a}{2}+\frac {A\,a\,1{}\mathrm {i}}{2}\right )\,\mathrm {tan}\left (c+d\,x\right )+\frac {A\,a}{3}}{d\,{\mathrm {tan}\left (c+d\,x\right )}^3}-\frac {a\,\mathrm {atan}\left (2\,\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,\left (B+A\,1{}\mathrm {i}\right )\,2{}\mathrm {i}}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [B] time = 0.78, size = 168, normalized size = 1.89 \[ - \frac {i a \left (A - i B\right ) \log {\left (e^{2 i d x} - e^{- 2 i c} \right )}}{d} + \frac {- 8 i A a - 6 B a + \left (18 i A a e^{2 i c} + 18 B a e^{2 i c}\right ) e^{2 i d x} + \left (- 18 i A a e^{4 i c} - 12 B a e^{4 i c}\right ) e^{4 i d x}}{- 3 d e^{6 i c} e^{6 i d x} + 9 d e^{4 i c} e^{4 i d x} - 9 d e^{2 i c} e^{2 i d x} + 3 d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________